package CSISL4pk;

import java.awt.Color;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

public class PersonFrame extends JPanel
{

    JLabel lastLabel = new JLabel("LAST");
    JLabel firstLabel = new JLabel("FIRST");
    JLabel middleLabel = new JLabel("MIDDLE");
    JLabel dobLabel = new JLabel("D.O.B.");
    JLabel phoneLabel = new JLabel("PHONE");
    JLabel ssnLabel = new JLabel("SSN");
    JLabel genderLabel = new JLabel("SEX");
    JLabel addressLabel = new JLabel("ADDRESS");
    JPanel namePanel = new JPanel();
    JPanel addressPanel = new JPanel();
    JLabel unitLabel = new JLabel("UNIT");
    JTextField lastText = new JTextField();
    JTextField firstText = new JTextField();
    JTextField middleText = new JTextField();
    JTextField dobM = new JTextField("0");
    JTextField dobY = new JTextField("0");
    JTextField dobD = new JTextField("0");
    JTextField phoneArea = new JTextField();
    JTextField phonePrefix = new JTextField();
    JTextField phoneSuffix = new JTextField();
    JTextField ssnText = new JTextField("0");
    JTextField genderText = new JTextField();
    JTextField unitText = new JTextField();
    JLabel streetLabel, cityLabel, zipLabel, stateLabel;
    JTextField streetField, cityField,
            stateField, zipField;
    int addressX, addressY;

    public PersonFrame()
    {
        setLayout(null);
        //size of window
        setSize(450, 150);
        setBackground(Color.lightGray);
        setVisible(true);

        //setting Bounds
        lastLabel.setBounds(20, 0, 40, 30);
        lastText.setBounds(55, 0, 105, 30);
        firstLabel.setBounds(160, 0, 40, 30);
        firstText.setBounds(195, 0, 100, 30);
        middleLabel.setBounds(295, 0, 60, 30);
        middleText.setBounds(345, 0, 100, 30);
        dobLabel.setBounds(15, 90, 40, 30);
        dobY.setBounds(55, 90, 40, 30);
        dobM.setBounds(95, 90, 30, 30);
        dobD.setBounds(125, 90, 30, 30);
        ssnLabel.setBounds(165, 90, 40, 30);
        ssnText.setBounds(195, 90, 80, 30);
        genderLabel.setBounds(285, 90, 40, 30);
        genderText.setBounds(315, 90, 30, 30);
        unitLabel.setBounds(290, 30, 40, 30);
        unitText.setBounds(330, 30, 50, 30);

        addressX = 45;
        addressY = 20;

        addressLabel = new JLabel("ADDRESS");
        addressLabel.setSize(80, 30);
        addressLabel.setLocation(100, 250);

        streetLabel = new JLabel("STREET");
        streetLabel.setSize(80, 30);
        streetLabel.setLocation(addressX - 40, addressY+10);

        streetField = new JTextField();
        streetField.setSize(230, 30);
        streetField.setLocation(addressX+10, addressY+10);

        cityLabel = new JLabel("CITY");
        cityLabel.setSize(80, 30);
        cityLabel.setLocation(addressX - 20, addressY + 40);

        cityField = new JTextField();
        cityField.setSize(160, 30);
        cityField.setLocation(addressX+10, addressY + 40);

        stateLabel = new JLabel("STATE");
        stateLabel.setSize(80, 30);
        stateLabel.setLocation(addressX + 170, addressY + 40);

        stateField = new JTextField();
        stateField.setSize(30, 30);
        stateField.setLocation(addressX + 210, addressY + 40);

        zipLabel = new JLabel("ZIP");
        zipLabel.setSize(80, 30);
        zipLabel.setLocation(addressX + 250, addressY + 40);

        zipField = new JTextField();
        zipField.setSize(50, 30);
        zipField.setLocation(addressX + 280, addressY + 40);

        //add components
        add(lastText);
        add(firstText);
        add(middleText);
        add(dobY);
        add(dobM);
        add(dobD);
        add(ssnText);
        add(lastLabel);
        add(firstLabel);
        add(middleLabel);
        add(dobLabel);
        add(ssnLabel);
        add(streetLabel);
        add(cityLabel);
        add(stateLabel);
        add(zipLabel);
        add(stateLabel);
        add(streetField);
        add(cityField);
        add(stateField);
        add(zipField);
        add(genderLabel);
        add(genderText);
        add(unitLabel);
        add(unitText);
    }
}
